package com.dzx.scala.dzxbootscala.service;

import com.dzx.scala.dzxbootscala.dao.MetaDatabaseDao;
import com.dzx.scala.dzxbootscala.entity.MetaDatabase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author DuanZhaoXu
 * @ClassName:
 * @Description:
 * @date 2018年12月20日 14:20:06
 */
@Service
public class MetaDatabaseService {

    @Autowired
    private MetaDatabaseDao metaDatabaseDao;


    @Transactional
    public void save(MetaDatabase metaDatabase) {
        metaDatabaseDao.save(metaDatabase);
    }

    public Iterable<MetaDatabase> query() {
        return metaDatabaseDao.findAll();
    }


    @Transactional
    public  void  update(MetaDatabase  metaDatabase){  metaDatabaseDao.save(metaDatabase);}

    public void  delete(Integer id){
       metaDatabaseDao.delete(id);
    }
}
